package com.alone.embedded.lucene.annotation;

import com.alone.embedded.lucene.constant.FieldType;
import org.apache.lucene.index.IndexableField;

import java.lang.annotation.*;

/**
 * id类型注解<br/>
 * 可以理解成数据库主键
 *
 * @author Alone
 * @date 2022/8/23 9:31 上午
 */
@Target(ElementType.FIELD)
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface DocId {

    /**
     * 字段类型
     */
    FieldType type() default FieldType.LONG;

    /**
     * 扩展的字段
     *
     * @return Class[]
     * @see com.alone.embedded.lucene.constant.FieldFactory
     */
    Class<? extends IndexableField>[] extensionFields() default {};

}
